
// const DesMessage = {};
// DesMessage.name = String;
// DesMessage.uniqueid = Number;
// DesMessage.url = String;
// DesMessage.role = String;
// DesMessage.content = String;

const ParseData = function () {
    let that = {};

    that.parseInfo = function (data) {
        if (!data) return;
        let desMsg = cc.loader.getRes(data).json.root.startdes;
        if (!desMsg) return;

        let JsonData = [];
        for (let i = 0; i < desMsg.length; i++) {
            let info = {
                "name": desMsg[i].name,
                "uniqueid": Number(desMsg[i].uniqueid),
                "url": desMsg[i].url,
                "role": desMsg[i].role,
                "content": desMsg[i].content,
            }
            JsonData[i] = (info);
        }

        console.log("JsonData = " + JSON.stringify(JsonData));
        return JsonData;
    };

    return that;
}
export default ParseData;

